<?php include '_init_.php';?>
<?php
$act = isset($_REQUEST['act'])?$_REQUEST['act']:'';
$dtFrame = new DataTable(constant('DB_TABLE_PHOTO_FRAME'));
$framList = $dtFrame->get_list('','name');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<link href="css/main.css" rel="stylesheet" type="text/css" />
<script language="javascript">
var size_id = '<?php echo $_REQUEST['size_id'];?>';
var frame_index = '<?php echo $_REQUEST['frame_index'];?>';
var frame_id = '<?php echo $_REQUEST['frame_id'];?>';
$(function(){
	$('#select2 option[value='+frame_id+']').attr('selected',true);
	<?php if($_REQUEST['addcostcall']):?>
	var isgift = '<?php echo $_REQUEST['isgift'];?>';
	if(isgift == 'Y')
	{
		$('input[name=isgift]').attr('checked',true)
	}
	<?php endif;?>
});
function set_frame()
{
	<?php if($_REQUEST['addcostcall']):?>
		var isgift = $('input[name=isgift]').attr('checked')?'Y':'N';
		window.parent.dialog_function_set_size_frame_callback(size_id,frame_index,$('#select2').val(),$('#select2 option[selected]').text(),isgift);

	<?php else:?>
		window.parent.dialog_function_set_size_frame_callback(size_id,frame_index,$('#select2').val(),$('#select2 option[selected]').text());

	<?php endif;?>
	return false;
}
</script>
</head>

<body>

<div id="article-admin" class="clearfix">
  <ul>
    	<?php if($_REQUEST['addcostcall']):?>
  	<li class="article-1c" style="color: #990000;"><input type="checkbox" class="article-adminb-chbox" name="isgift">贈品 </li>
    <?php endif;?>
   <li class="article-1c">
     相片尺寸<img src="images/line3.gif" width="21" height="12" /><?php echo $_REQUEST['size_name'];?></li>
    <li class="article-1c">
     框號
    <select name="select2" class="maine-keyinm2" id="select2" >
         <option value="">無</option>
         <?php foreach($framList as $tmpData):?>
         <option value="<?php echo $tmpData['id'];?>"><?php echo $tmpData['name'];?></option>
         <?php endforeach;?>
       </select></li>
     <li class="article-1b">
       <input name="" type="button" class="article-1a_btn" value="儲存" onclick="return set_frame();"/></li>
  </ul>

</div>
</body>
</html>
